{extends file='quotes_and_sales/all_transaction.add.tpl'}

{block name='informasi_order'}
<div class="form-title-left">
    <span class="form-title-text">INFORMASI ORDER</span>
</div>
<div class="form-title-hr"></div>
<table class="form-table" cellpadding="0" cellspacing="0">
    <tr>
        <td class="form-order-name"><span>Scope</span></td>
        <td class="dot"><span>:</span></td>
        <td>
            <select id="scope" class="form-order-select">
            <option value="WORLD"{if $scope=='WORLD'} selected="selected"{/if}>World</option>
            <option value="USA"{if $scope=='USA'} selected="selected"{/if}>USA</option>
            </select>
        </td>
    </tr>
    <tr>
        <td class="form-order-name"><span>Jumlah Item</span></td>
        <td class="dot"><span>:</span></td>
        <td>
            <select id="jumlah_item" class="form-order-select">
            {for $x = 1 to 40}
            <option value="{$x}"{if count($jumlah_item)==$x} selected="selected"{/if}>{$x}</option>
            {/for}
            </select>
        </td>
    </tr>
</table>
<ol id="items">
    {for $i = 0 to $jumlah_item-1}
    <li class="products" id="product-{$i}">
        <table class="form-table order-information" cellpadding="0" cellspacing="0">
            <tr>
                <td class="form-order-name2"><span>Nama Barang</span></td>
                <td class="dot"><span>:</span></td>
                <td><input type="text" name="order[nama_barang][]" class="form-order-text" value="{$order->nama_barang[$i]|default:''}" /></td>
            </tr>
            <tr>
                <td class="form-order-name2"><span>URL Item</span></td>
                <td class="dot"><span>:</span></td>
                <td><input type="text" name="order[url_item][]" class="form-order-text" value="{$order->url_item[$i]|default:''}" /></td>
            </tr>
            <tr>
                <td class="form-order-name2"><span>Jumlah</span></td>
                <td class="dot"><span>:</span></td>
                <td>
                    <table class="inner-table" cellpadding="0" cellspacing="0">
                        <tr>
                            <td><input type="text" name="order[jumlah][]" class="form-order-text5" value="{$order->jumlah[$i]|default:''}" /></td>
                            <td>Ukuran : </td>
                            <td><input type="text" name="order[ukuran][]" class="form-order-text5" value="{$order->ukuran[$i]|default:''}" /></td>
                            <td>Warna : </td>
                            <td><input type="text" name="order[warna][]" class="form-order-text5" value="{$order->warna[$i]|default:''}" /></td>
                        </tr>
                    </table>
                    <div class="clear"></div>
                </td>
            </tr>
            <tr>
                <td class="form-order-name2"><span>Harga Item [$]</span></td>
                <td class="dot"><span>:</span></td>
                <td><input type="text" name="order[harga_item][]" class="form-order-text" value="{$order->harga_item[$i]|default:''}" /></td>
            </tr>
            <tr>
                <td class="form-order-name2"><span>Berat Item Aktual [KGs]</span></td>
                <td class="dot"><span>:</span></td>
                <td><input type="text" name="order[berat_item][]" class="form-order-text" value="{$order->berat_item[$i]|default:''}" /></td>
            </tr>
            <tr>
                <td class="form-order-name2"><span>Dimensi Item</span></td>
                <td class="dot"><span>:</span></td>
                <td>
                    <table class="inner-table" cellpadding="0" cellspacing="0">
                        <tr>
                            <td><input type="text" name="order[panjang][]" class="form-order-text3" value="{$order->panjang[$i]|default:''}" /></td>
                            <td>x&nbsp;</td>
                            <td><input type="text" name="order[lebar][]" class="form-order-text3" value="{$order->lebar[$i]|default:''}" /></td>
                            <td>x&nbsp;</td>
                            <td><input type="text" name="order[tinggi][]" class="form-order-text3" value="{$order->tingi[$i]|default:''}" /></td>
                        </tr>
                    </table>
                    <div class="clear"></div>
                </td>
            </tr>
            <tr>
                <td class="form-order-name2"><span>Photo Item</span></td>
                <td class="dot"><span>:</span></td>
                <td><input type="file" name="order[photo_item][]" value="{$order->photo_item[$i]|default:''}" class="form-order-text4" /></td>
            </tr>
            <tr>
                <td class="form-order-name2"><span>Shipping Cost</span></td>
                <td class="dot"><span>:</span></td>
                <td><input type="text" name="order[shipping_cost][]" class="form-order-text2" value="{$order->shipping_cost[$i]|default:''}" /></td>
            </tr>
        </table>
        <br />
    </li>
    {/for}
</ol>
<br />
{literal}
<script type="text/javascript">
<!--
(function($){
    $('#jumlah_item').change(function(e){
        var index = $(this).val();
        var length = $('#items .products').size();

        if(index > length) {
            for(; length<index; length++) {
                var elem = $('#product-0').clone();

                elem.attr('id', 'product-'+length);
                elem.find(':input').val('');
                elem.appendTo($('#items'));
            }
        } else {
            for(; length>index; length--) $('#items .products:last').remove();
        }
    });
})(jQuery);
 -->
</script>
{/literal}
<div class="form-hr"></div>
<table class="form-table sub-total" cellpadding="0" cellspacing="0">
    <tr>
        <td class="form-order-name"><span>Sub Total Order [USD]</span></td>
        <td class="dot"><span>:</span></td>
        <td><input type="text" name="sub_total" class="form-order-text" value="{$field->sub_total}" /></td>
    </tr>
    <tr>
        <td class="form-order-name"><span>Services Charges [USD]</span></td>
        <td class="dot"><span>:</span></td>
        <td><input type="text" name="service_charge" class="form-order-text" value="{$field->sub_total}" /></td>
    </tr>
    <tr>
        <td class="form-order-name"><span>Exchange Rate</span></td>
        <td class="dot"><span>:</span></td>
        <td><input type="text" name="rate" class="form-order-text2" value="{$field->rate}" disabled /></td>
    </tr>
    <tr>
        <td class="form-order-name"><span>Order Grand Total</span></td>
        <td class="dot"><span>:</span></td>
        <td><input type="text" name="total" class="form-order-text" value="{$field->total}" /></td>
    </tr>
</table>
<br /><br />

<div class="buttons">
    <input type="reset" value="Reset" />
    <input type="submit" value="Submit" />
</div>
{/block}